<?php
 If ($nombre == 0) { header ("location: ./texte.html") ; Exit () ; }
?>
<HTML>
 <HEAD>
  <TITLE>Importation et traduction des donn&eacute;es d'un fichier TEXTE.</TITLE>
 </HEAD>
 <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
  <TABLE ALIGN=CENTER BORDER=0 CELLPADDING=0 CELLSPACING=0>
   <TR>
    <TD ALIGN=CENTER><H1>Importation et traduction des donn&eacute;es d'un fichier TEXTE.</H1></TD>
   </TR>
   <TR>
    <TD><HR></TD>
   </TR>
   <FORM ACTION="./texte_2.php" METHOD="POST" ENCTYPE="multipart/form-data">
    <INPUT TYPE=HIDDEN NAME="MAX_FILE_SIZE" VALUE="1000000">
<?php
 Include ("../include/config.inc") ;
 Include ("../../include/config.cfg") ;
 Include ("../../include/sql.inc") ;

 $col_fond = "#E2C778" ;

 $id = SQL_connexion ($serveur, $admin_login, $admin_passe, $bdd) ;
 $requete = "SELECT id, intitule FROM proprietes ORDER BY intitule" ;
 $resultats = SQL_commande ($requete, $id) ;
 $ok = SQL_fermeture ($id) ;
 $nbr = SQL_nbr_lignes ($resultats) ;

 For ($i = 0 ; $i < $nbr ; $i++)
  {
   $ligne = SQL_tableau_associatif ($resultats, "") ;
   $table [$i][0] = $ligne ["id_propriete"] ;
   $table [$i][1] = $ligne ["intitule"] ;
  }
 
 Echo "   <INPUT TYPE=HIDDEN NAME=nombre VALUE=\"".$nombre."\">\n" ;
 For ($i = 1 ; $i <= $nombre ; $i++)
  {
   Echo "    <TR>\n" ;
   Echo "     <TD>\n" ;
   Echo "      <TABLE ALIGN=CENTER BORDER=1 CELLPADDING=0 CELLSPACING=0>\n" ;
   Echo "       <TR>\n" ;
   Echo "        <TD>\n" ;
   Echo "         <TABLE ALIGN=CENTER BORDER=0 CELLPADDING=0 CELLSPACING=0>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=CENTER COLSPAN=3><B>Fichier Num&eacute;ro ".$i."</B></TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=RIGHT>&nbsp;<B>Description :</B>&nbsp;</TD>\n" ;
   Echo "           <TD><INPUT TYPE=TEXT NAME=desc_".$i." SIZE=60></TD>\n" ;
   Echo "           <TD>&nbsp;</TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=RIGHT>&nbsp;<B>Nom du fichier :</B>&nbsp;</TD>\n" ;
   Echo "           <TD ALIGN=LEFT><INPUT TYPE=FILE NAME=fichier_".$i." SIZE=40></TD>\n" ;
   Echo "           <TD>&nbsp;</TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=RIGHT>&nbsp;<B>Propri&eacute;t&eacute; :</B>&nbsp;</TD>\n" ;
   Echo "           <TD ALIGN=LEFT>\n" ;
   Echo "            <SELECT NAME=prop_".$i.">\n" ;
   For ($j = 0 ; $j < $nbr ; $j++)
    {   
     Echo "             <OPTION VALUE=".$table [$j][0].">".$table [$j][1]."\n" ;
    }
   Echo "            </SELECT>\n" ;
   Echo "           </TD>\n" ;
   Echo "           <TD>&nbsp;</TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=RIGHT>&nbsp;<B>S&eacute;parateur de champs :</B>&nbsp;</TD>\n" ;
   Echo "           <TD ALIGN=LEFT><INPUT TYPE=TEXT NAME=sep_".$i." SIZE=20 MAXLENGTH=50 VALUE=\";\"></TD>\n" ;
   Echo "           <TD>&nbsp;</TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=RIGHT>&nbsp;<B>Num&eacute;ro de champs pour</B>&nbsp;</TD>\n" ;
   Echo "           <TD>\n" ;
   Echo "            <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 ALIGN=LEFT>\n" ;
   Echo "             <TR>\n" ;
   Echo "              <TD>&nbsp;le Nom :&nbsp;</TD>\n" ;
   Echo "              <TD><INPUT TYPE=TEXT NAME=ch1_".$i." VALUE=2 SIZE=3 MAXLENGTH=2></TD>\n" ;
   Echo "              <TD>,&nbsp;le Pr&eacute;nom :&nbsp;</TD>\n" ;
   Echo "              <TD><INPUT TYPE=TEXT NAME=ch2_".$i." VALUE=4 SIZE=3 MAXLENGTH=2></TD>\n" ;
   Echo "              <TD>,&nbsp;la Date naissance :&nbsp;</TD>\n" ;
   Echo "              <TD><INPUT TYPE=TEXT NAME=ch3_".$i." VALUE=5 SIZE=3 MAXLENGTH=2></TD>\n" ;
   Echo "              <TD>et&nbsp;la Classe :&nbsp;</TD>\n" ;
   Echo "              <TD><INPUT TYPE=TEXT NAME=ch4_".$i." VALUE=16 SIZE=3 MAXLENGTH=2></TD>\n" ;
   Echo "             </TR>\n" ;
   Echo "            </TABLE>\n" ;
   Echo "           </TD>\n" ;
   Echo "           <TD>&nbsp;</TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\">\n" ;
   Echo "           <TD ALIGN=RIGHT>&nbsp;<B>Format de la date :</B>&nbsp;</TD>\n" ;
   Echo "           <TD ALIGN=LEFT>\n" ;
   Echo "            <SELECT NAME=format_date_".$i.">\n" ;
   Echo "             <OPTION VALUE=0>JJMMAAAA\n" ;
   Echo "             <OPTION VALUE=1 SELECTED>AAAAMMJJ\n" ;
   Echo "             <OPTION VALUE=2>JJ/MM/AAAA\n" ;
   Echo "             <OPTION VALUE=3>AAAA/MM/JJ\n" ;
   Echo "             <OPTION VALUE=4>JJ-MM-AAAA\n" ;
   Echo "             <OPTION VALUE=5>AAAA-MM-JJ\n" ;
   Echo "            </SELECT>\n" ;
   Echo "           </TD>\n" ;
   Echo "           <TD>&nbsp;</TD>\n" ;
   Echo "          </TR>\n" ;
   Echo "          <TR BGCOLOR=\"".$col_fond."\"><TD COLSPAN=3>&nbsp;</TD></TR>\n" ;
   Echo "         </TABLE>\n" ;
   Echo "        </TD>\n" ;
   Echo "       </TR>\n" ;
   Echo "      </TABLE>\n" ;
   Echo "     </TD>\n" ;
   Echo "    </TR>\n" ;
   Echo "    <TR>\n" ;
   Echo "     <TD><BR></TD>\n" ;
   Echo "    </TR>\n" ;
   
  } 
?>
    <TR>
     <TD ALIGN=CENTER><INPUT TYPE=SUBMIT NAME=submit VALUE="&nbsp;&nbsp;Valider&nbsp;&nbsp;"></TD>
    </TR>
   </TABLE>
  </FORM>
  <HR>
  <CENTER>
   <FORM>
    <INPUT TYPE=BUTTON VALUE="  ANNULER : Retour au Sommaire  " onClick="location='../'">
   </FORM>
  </CENTER>
 </BODY>
</HTML>
